package com.atwulidun.facade09;

public class HomeTheatreFacade {
    private static Light light;
    private static Popcorn popcorn;
    private static Projector projector;
    private static Screen screen;
    private static Stereo stereo;
    private static DVDPlayer dvdPlayer;

    public HomeTheatreFacade() {
        light = Light.getInstance();
        popcorn = Popcorn.getInstance();
        projector = Projector.getInstance();
        screen = Screen.getInstance();
        stereo = Stereo.getInstance();
        dvdPlayer = DVDPlayer.getInstance();
    }

    // 操作分为ready，play，pause，end四步
    public void ready() {
        popcorn.on();
        popcorn.pop();
        screen.down();
        projector.on();
        stereo.on();
        dvdPlayer.on();
        light.dim();
    }


    public void play() {
        dvdPlayer.play();
    }


    public void pause() {
        dvdPlayer.pause();
    }

    public void end() {
        popcorn.off();
        light.bright();
        screen.up();
        projector.off();
        stereo.off();
        dvdPlayer.off();
    }
}
